<template>
	<view style="width: 100vw; height: 100vh;">
		<view v-for="(item,index) in dataInfo" :key="index">
			{{item}}
		</view>
		<QRCodeScanner :fps="10" style="width: 100%; height: 100%;" @transmitValue="onScan" />
	</view>
</template>

<script>
	import QRCodeScanner from '@/components/QRCodeScanner.vue';

	export default {
		data() {
			return {
				dataInfo: []
			}
		},
		components: {
			QRCodeScanner,
		},
		methods: {
			onScan(result) {
				this.dataInfo.push(result)
				// console.log('QR Code result:', result);
			},
		},
	};
</script>

<style scoped>
	view {
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>